<?php if (!empty($header_menu)): ?>
    <div id="header-menu-wrapper">
        <div id="header-menu">
        <?php
        if ($logged_in) {
            print "<div id=\"login\">";
            print "<form id=\"user-login-form\" method=\"post\" action=\"#\" name=\"user-login-form\">";
            print "<p>Welcome, <b>$user->mail</b>!";

            $account_link = url('user/' . $user->id);
            print "<a class=\"textLink\"  href=\"$account_link\"> profile</a> | ";
            $logout_link = url('logout');
            print "<a class=\"textLink\" href=\"$logout_link\">Logout</a></p></form>";
            print "</div>";
        }
        ?>
        <?php print $header_menu; ?>
    </div>
</div>
<?php endif; ?>

        <div id="header-wrapper">
            <div id="header" class="clear-block<?php if ($header): ?> with-blocks<?php endif; ?>">

        <?php if (!empty($logo) || !empty($site_name) || !empty($site_slogan)): ?>
                <div id="branding-wrapper" class="clear-block">
                    <div id="branding">

                <?php if (!empty($logo)): ?>
                    <div id="logo">
                        <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home">
                            <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
                        </a>
                    </div>
                <?php endif; ?>

                <?php if (!empty($site_name) || !empty($site_slogan)): ?>
                        <div id="name-and-slogan">
                    <?php if (!empty($site_name)): ?>
                            <div id="site-name">
                                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><?php print $site_name; ?></a>
                            </div>
                    <?php else: /* Use h1 when the content title is empty */ ?>
                                <h1 id="site-name">
                                    <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><?php print $site_name; ?></a>
                                </h1>
                    <?php endif; ?>

                    <?php if (!empty($site_slogan)): ?>
                                <div id="site-slogan"><?php print $site_slogan; ?></div>
                    <?php endif; ?>
                         </div> <!-- /name-and-slogan -->
                <?php endif; ?>
                    </div> <!-- /#branding -->
                </div> <!-- /#branding-wrapper -->
        <?php endif; ?>

        <?php if (!empty($header)): ?>
                                        <div class="region region-header">
            <?php print $header; ?>
                                    </div>
        <?php endif; ?>
    </div> <!-- /#header -->
</div> <!-- /#header-wrapper -->
